<?php
    define('ROOT', dirname(dirname(__FILE__)));
    function __autoload($class_name)
    {
        require_once ROOT. "/class/" . $class_name . ".class.php";
    }
    $facebook = new FacebookApi();

    $user_profile = $facebook->_getMyProfile();
    $birthday = $user_profile['birthday'];
    $year_me = '';
    if (isset($birthday)) {
        $arrBirthday = explode("/", $birthday);
        $year_me = $arrBirthday[2];
    } else {
        $loginUrl = $facebook->getLoginUrl($facebook->paramsp);
        exit("Loading ...<script>window.top.location.replace('$loginUrl');</script>");
    }

    $_SESSION['name'] = $user_profile['name'];
    $_SESSION['uid'] = $user_profile['id'];
?>

<a href="<?php echo $facebook->getLogoutUrl();?>" class="span8 subheader padding10" style="text-align: right;">
    <?php echo $_SESSION['name'];?>&nbsp;
    <img class="cycle" src="https://graph.facebook.com/<?php echo $_SESSION['uid'];?>/picture">
</a>